package video_category_map

import (
	"supervideo/app/models"
	"supervideo/pkg/database"
)

type VideoCategoryMap struct {
	models.BaseModel

	videoId          uint64
	CategoryId       uint64
	CategoryParentId uint64

	models.CommonTimestampsField
}

func (videoCategoryMap *VideoCategoryMap) Create() {
	database.DB.Create(&videoCategoryMap)
}

func (videoCategoryMap *VideoCategoryMap) Save() (rowAffected int64) {
	result := database.DB.Save(&videoCategoryMap)
	return result.RowsAffected
}

func (videoCategoryMap *VideoCategoryMap) Delete() (rowAffected int64) {
	result := database.DB.Delete(&videoCategoryMap)
	return result.RowsAffected
}
